<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Những dòng có dấu <span class="required">*</span> là bắt buộc.</p>

	<?php //echo $form->errorSummary($model);
	$errClass = ''; 
	if($form->errorSummary($model))
		$errClass = 'has-error';
	?>
	<div class="row <?php echo $errClass ?>">
		<?php echo $form->labelEx($model,'username', array('label'=>'Tên đăng nhập')); ?>
		<?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>128,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>

	<div class="row <?php echo  $errClass ?>">
		<?php echo $form->labelEx($model,'password', array('label'=>'Mật khẩu')); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>128,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>

	<div class="row <?php echo  $errClass ?>">
		<?php echo $form->labelEx($model,'email', array('label'=>'Email')); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>128,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'profile', array('label'=>'Thông tin thêm')); ?>
		<?php echo $form->textArea($model,'profile',array('rows'=>6, 'cols'=>50,'class'=>'form-control')); ?>
		<?php echo $form->error($model,'profile'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Tạo mới' : 'Lưu', array('class'=>'btn btn-primary')); ?>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->